package com.cjbdi.service;

import java.util.List;

import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cjbdi.dao.UserGonggaoRepository;
import com.cjbdi.entity.UserGonggao;

@Service
@Transactional
public class UserGonggaoService {
	@Autowired
    private UserGonggaoRepository userGonggaoRepository;
	
	public void save(UserGonggao userGonggao) {
		userGonggaoRepository.save(userGonggao);

    }
	
	public boolean delete(int id) {
		// TODO Auto-generated method stub
		Integer i = userGonggaoRepository.delete(id);
    	if(i>0) {
    		return true;
    	}else {
    		return false;
    	}
	}
	
	public List<UserGonggao> getGonggaobyIpAndid(String ip,int gonggaoid){
    	return userGonggaoRepository.getGonggaobyIpAndid(ip,gonggaoid);
	}
	
	public List<?> getGonggaobyIp(String ip){
		List<?> list = userGonggaoRepository.getGonggaobyIp(ip);
    	return list;
	}
	
	public List getGonggaobyId(int gonggaoid){
		List list = userGonggaoRepository.getGonggaobyId(gonggaoid);
    	return list;
	}
}
